import {defineStore} from "pinia";
import {getSysRoleList} from "@/api/role";
import type {TRoleInfo} from "@/api/role/type.ts";

type TState = {
    roleList:TRoleInfo[],
    keyword:string
}
const useRoleStore = defineStore("Role",{
    state():TState{
        return {
            roleList:[],
            keyword:""
        }
    },
    actions:{
        async getSysRoleListAsync(){
            const result = await getSysRoleList(this.keyword);
            this.roleList = result.roleList;
        }
    }
});
export default useRoleStore;